package com.crazy.base.common.utils.id;

import cn.hutool.core.util.IdUtil;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
public class SnowflakeGenerator implements UidGenerator {

    private final Long workId;

    private final Long dataCenterId;

    @Override
    public long nextId() {
        return IdUtil.getSnowflake(this.workId, this.dataCenterId).nextId();
    }
}
